home *** CD-ROM | disk | FTP | other *** search
- on mouseDown
- global canPass
- set canPass to 0
- set the castNum of sprite the clickOn to the number of cast "Pass.Down"
- updateStage()
- if passable() then
- set canPass to 1
- end if
- end
-
- on mouseUp
- global theSenetGame, canPass
- set the castNum of sprite the clickOn to the number of cast "Pass.Up"
- puppetSound("Pass")
- updateStage()
- if canPass then
- passTurn(theSenetGame)
- end if
- end
-
- on passable
- global theSenetGame, aMoveMade
- if aMoveMade then
- set temptext to the text of cast "TheMsg"
- set the text of cast "TheMsg" to "You must first roll the dice."
- updateStage()
- repeat while the mouseDown
- nothing()
- end repeat
- set the text of cast "TheMsg" to temptext
- updateStage()
- return 0
- else
- set legalMove to 0
- if the playerMoving of theSenetGame = 1 then
- set PLAYER to "Player 1"
- else
- set PLAYER to "Player 2"
- end if
- if the text of cast PLAYER = "Light" then
- repeat with x = 1 to count(the whitePiecesSpriteList of theSenetGame)
- set aMove to generateALegalMove(theSenetGame, getAt(the whitePiecesSpriteList of theSenetGame, x))
- if aMove <> 0 then
- set legalMove to 1
- exit repeat
- end if
- end repeat
- else
- repeat with x = 1 to count(the blackPiecesSpriteList of theSenetGame)
- set aMove to generateALegalMove(theSenetGame, getAt(the blackPiecesSpriteList of theSenetGame, x))
- if aMove <> 0 then
- set legalMove to 1
- exit repeat
- end if
- end repeat
- end if
- if legalMove then
- set temptext to the text of cast "TheMsg"
- set the text of cast "TheMsg" to "You cannot pass; a legal move is available."
- updateStage()
- repeat while the mouseDown
- nothing()
- end repeat
- set the text of cast "TheMsg" to temptext
- updateStage()
- return 0
- else
- repeat while the mouseDown
- nothing()
- end repeat
- return 1
- end if
- end if
- end
-